{% extends 'layout_blog.html' %}

{% block page_title %}Preview your comment{% endblock %}
{% block head_title %}Preview your comment{% endblock %}

{% block posts %}
<form action="{{ request.path }}" method="post">

  {% if not comment_form.has_errors %}
    <div class="document">
      <div>
        <strong>{{ comment.person_name }}</strong> wrote:
      </div>

      {{ comment.comment|escape|urlizetrunc:40|linebreaks }}

      <p><input class="submit" type="submit" name="post" value="Post public comment" /></p>
    </div>
  {% endif %}

  <div class="comment-form">
    {% if comment_form.has_errors %}<p class="error">Please correct the following errors:</p>{% endif %}

    <p>
      <label for="id_person_name">Your name:</label>
      {{ comment_form.person_name }}
      <span class="error">{{ comment_form.person_name.errors.0 }}</span>
    </p>
    <p>
      <label for="id_comment">Comment:</label><br />
      {{ comment_form.comment }}
      {% if comment_form.comment.errors %}<div class="error">{{ comment_form.comment.errors.0 }}</div>{% endif %}
    </p>
    <p>
      <input type="hidden" name="options" value="{{ options }}" />
      <input type="hidden" name="target" value="{{ target }}" />
      <input type="hidden" name="gonzo" value="{{ hash }}" />
      <input type="hidden" name="answer" value="42" />
      <input class="submit" type="submit" name="preview" value="Preview revised comment" />
    </p>
  </div>

</form>    
{% endblock %}
